Skip to content

feat: add enable and disable methods to RulesEndpoint#270

Open
pachuho wants to merge 1 commit into
SmartThingsCommunity:mainfrom
pachuho:feat/rules-enable-disable
Open

feat: add enable and disable methods to RulesEndpoint#270
pachuho wants to merge 1 commit into
SmartThingsCommunity:mainfrom
pachuho:feat/rules-enable-disable

Conversation

@pachuho

@pachuho pachuho commented Jul 8, 2026

Copy link
Copy Markdown

Adds enable() and disable() to RulesEndpoint, covering the rule status endpoints:

  • PUT /rules/{ruleId}/status/enable?locationId={locationId}
  • PUT /rules/{ruleId}/status/disable?locationId={locationId}

These are in the SmartThings public Postman workspace ("Update Rule status (enable/disable)") but missing from the SDK. SmartThingsCommunity/smartthings-cli#500 asks for enable/disable in the CLI and notes it needs SDK support first — I'd like to follow up with a CLI PR once this lands.

Both methods return Promise<void> since the API responds with 204 and no body.

Tested against the live API with a w:rules:* scoped token: both calls return 204 and a subsequent GET shows status toggling between Enabled/Disabled. Unit tests added, lint and full suite pass, changeset included.

@changeset-bot

changeset-bot Bot commented Jul 8, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 32aa59f

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@smartthings/core-sdk Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Adds support for the rule status endpoints (PUT /rules/{id}/status/enable
and PUT /rules/{id}/status/disable). These endpoints are available in the
SmartThings public Postman workspace but were not previously exposed in
this SDK.

Verified against the live API: both calls return 204 and toggle the
rule's status field between Enabled and Disabled.

First step toward SmartThingsCommunity/smartthings-cli#500.
@pachuho pachuho force-pushed the feat/rules-enable-disable branch from f085891 to 32aa59f Compare July 8, 2026 05:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant